<!doctype html>
<html lang="zh-CN">
<head>
    <!-- 必须的 meta 标签 -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap 的 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css"
          integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">

    <title>注册界面</title>
</head>
<body>
<div class="container">
    <div class="row" style="padding-top: 20px">
        <div class="col-sm"></div>
        <div class="col-sm">
            <h3 style="text-align: center">用户注册</h3>
            {% if register_form.captcha.errors %}
                <div calss="alert alert-warning" role="alert">
                    <strong>注册失败!</strong>验证码输入错误！
                </div>
            {% elif message %}
                <div class="alert alert-warning" role="alert">
                    <strong>注册失败!</strong>{{ message }}
                </div>
            {% endif %}
            <form action="/register/" method="POST">
                {% csrf_token %}
                <div class="form-group">
                    <label>{{ register_form.username.label }}</label>
                    <input type="text" class="form-control" name="username">
                </div>
                <div class="form-group">
                    <label>{{ register_form.email.label }}</label>
                    <input type="email" class="form-control" name="email">
                </div>
                <div class="form-group">
                    <label>{{ register_form.password1.label }}</label>
                    <input type="password" class="form-control" name="password1">
                    <small class="form-text text-muted">密码必须是字母、数字或者特殊符号组成.</small>
                </div>
                <div class="form-group">
                    <label>{{ register_form.password2.label }}</label>
                    <input type="password" class="form-control" name="password2">
                    <small class="form-text text-muted">密码必须是字母、数字或者特殊符号组成.</small>
                </div>
                <div class="form-group">
                    <label>{{ register_form.captcha.label }}</label>
                    {{ register_form.captcha }}
                </div>
                <a href="/login/" class="text-success">
                    <ins>用户登录</ins>
                </a>
                <button type="submit" class="btn btn-primary float-right">注册</button>
            </form>

        </div>
        <div class="col-sm">

        </div>
    </div>
</div>
<!-- JavaScript 文件是可选的。从以下两种建议中选择一个即可！ -->

<!-- 选项 1：jQuery 和 Bootstrap 集成包（集成了 Popper） -->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"
        integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
        crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-LCPyFKQyML7mqtS+4XytolfqyqSlcbB3bvDuH9vX2sdQMxRonb/M3b9EmhCNNNrV"
        crossorigin="anonymous"></script>

<!-- 选项 2：Popper 和 Bootstrap 的 JS 插件各自独立 -->
<!--
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.min.js" integrity="sha384-gRC4eoaRyQ8xv2X6Mnf+eOIrtON3wId3dAkwO0HQX26OrFBoLpjX/XWOJacSiZhL" crossorigin="anonymous"></script>
-->
</body>
</html>
